package com.woniu.his.app.client;

import com.woniu.his.app.client.param.PhoneLoginParam;
import com.woniu.his.app.client.param.RegistrationParam;
import com.woniu.his.app.client.result.DeptAllDoctorResult;
import com.woniu.his.app.client.result.DeptAllResult;
import com.woniu.his.app.client.result.RegHistoryResult;
import com.woniu.his.app.client.result.StaffSkdInfoResult;
import com.woniu.his.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "AppRegistrationClient",name="app",path="app")
public interface AppRegistrationClient {

    /**
     * 挂号
     *
     * @param param 参数
     * @return {@link Result}
     */
    @PostMapping("/registration")
    public Result registration(@RequestBody RegistrationParam param);

    /**
     * 找到所有科室
     *
     * @return {@link Result}<{@link List}<{@link DeptAllResult}>>
     */
    @GetMapping("/findAllDept")
    public Result<List<DeptAllResult>> findAllDept();

    /**
     * 找到所有医生通过科室id
     *
     * @param deptId 科室id
     * @return {@link Result}<{@link List}<{@link DeptAllResult}>>
     */
    @GetMapping("/findAllDoctorByDeptId")
    public Result<List<DeptAllDoctorResult>> findAllDoctorByDeptId(@RequestParam("deptId") Integer deptId);

    /**
     * 用户手机登录
     *
     * @param param 参数
     * @return {@link Result}
     */
    @PostMapping("/phoneLogin")
    public Result<String> phoneLogin(@RequestBody PhoneLoginParam param);

    /**
     * 发送验证码
     *
     * @param
     * @return
     */
    @GetMapping("/send")
    public Result getCode(@RequestParam("userPhone") String userPhone);

    /**
     * 查询员工所有规则和描述通过员工id
     *
     * @param staffId 员工id
     * @return {@link Result}<{@link List}<{@link StaffSkdInfoResult}>>
     */
    @GetMapping("queryStaffAllSkdByStaffId")
    public Result<List<StaffSkdInfoResult>> queryStaffAllSkdByStaffId(@RequestParam("staffId") Integer staffId);

    /**
     * 根据账单id查挂号数据
     * @param billId
     * @return
     */
    @GetMapping("queryRegByBillId")
    Result<RegHistoryResult> queryRegByBillId(@RequestParam("billId") Long billId);

    /**
     * 支付成功修改状态
     * @param billId
     * @return
     */
    @GetMapping("paySuccess")
    Result<Boolean> paySuccess(@RequestParam("billId") Long billId);
}
